package com.region.integral.business_user.consume.dao.delegate;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.region.integral.business_user.consume.dao.IBreach;
import com.region.integral.business_user.consume.dao.ICheckNo;
import com.region.integral.business_user.consume.dao.IComplaint;
import com.region.integral.business_user.consume.dao.IGoodsNotReal;
import com.region.integral.common_user.consume.dao.IBuildGroup;
import com.region.integral.common_user.consume.dao.IExchangeK;
import com.region.integral.common_user.consume.dao.IUnsubscribeGoods;
import com.region.integral.common_user.obtain.vo.IntegralData;
import com.region.integral.exception.IntegralException;

@Component("business_regulationObjectDelegate")
public class RegulationObjectDelegate {
	@Resource(name="iBreach")
	private IBreach iBreach;
	@Resource(name="iCheckNo")
	private ICheckNo iCheckNo;
	@Resource(name="iComplaint")
	private IComplaint iComplaint;
	@Resource(name="iGoodsNotReal")
	private IGoodsNotReal iGoodsNotReal;
	
	public boolean breach(int userid){
		IntegralData integralData = new IntegralData();
		try {
			iBreach.breach(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean checkNo(int userid,int noNum){
		IntegralData integralData = new IntegralData();
		try {
			iCheckNo.checkNo(userid, noNum, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean complaint(int userid){
		IntegralData integralData = new IntegralData();
		try {
			iComplaint.complaint(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean goodsNotReal(int userid){
		IntegralData integralData = new IntegralData();
		try {
			iGoodsNotReal.goodsNotReal(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	
}